class Solution {
public:
    string NumArr[10] = { "", "", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz" };
    vector<string> ret;
    string path;
    bool check[5];

    vector<string> letterCombinations(string digits) {
        if (digits.size() == 0) return ret;

        dfs(digits, 0);
        return ret;
    }

    void dfs(string digits, int pos)
    {
        if (pos == digits.size())
        {
            ret.push_back(path);
            return;
        }

        for (auto ch : NumArr[digits[pos] - '0'])
        {
            path += ch;
            dfs(digits, pos + 1);
            path.pop_back();
        }
    }
};